# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-yarl
pkgver=1.13.1
pkgrel=0
pkgdesc="Yet another URL library"
url="https://yarl.aio-libs.org/"
license="Apache-2.0"
arch="all"
depends="python3 py3-idna py3-multidict"
makedepends="
	cython
	py3-expandvars
	py3-gpep517
	py3-setuptools
	py3-wheel
	python3-dev
	"
checkdepends="py3-pytest-xdist py3-pytest-cov"
subpackages="$pkgname-pyc"
source="https://github.com/aio-libs/yarl/releases/download/v$pkgver/yarl-$pkgver.tar.gz"
builddir="$srcdir/yarl-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir "$builddir"/.dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	cd .testenv
	bin/python3 -m pytest -n auto -p no:warnings ../tests
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
8fccb36dbb019d02fc50f006a3a59decd413abfc6387fd7c1220444f4f79412be1d5119c32fd668b3d553fbaf4de64b9135345e8300c7fa025d892c847955f88  yarl-1.13.1.tar.gz
"
